package com.java.innerniming;

public class Student {
	/**
	 * 匿名内部类
	 */
	// 属性
	// 成员变量
	private String stuName;
	private String stuSex;
	private double stuScore;

	/**
	 * 行为
	 */
	// 学习行为
	public void doStuding() {
		System.out.println(this.stuName + " is studing...");
	}

	// 打印行为，若内部类不是public，是private,则只能调用此方法
	public void printMeFamily() {

		// 定义一个局部变量
		int stuAge = 20;
		System.out.println(new StuFamily("张三妈妈", "张三爸爸", "天津西青").getStuFamilyInfo());
	}

	public void printMeFamily2() {
		int stuAge = 20;
		// 匿名内部类接口的实现调用
		System.out.println(new FamilyInfoable() {

			@Override
			public String StuFamilyInfo() {
				String str = "年龄为" + stuAge + "的学生：" + stuName;
				return str;
			}

		}.StuFamilyInfo());

	}

	public void printMeFamily3() {
		int stuAge = 20;
		// 匿名内部类接口的实现调用
		System.out.println(new FamilyInfo() {

			@Override
			String FamilyAbstract() {
				String str1 = stuAge + "岁的" + "的小孩的名字叫" + stuName;
				return str1;
			}
		}.FamilyAbstract());
	}

	// 构造方法

	public Student(String stuName, String stuSex, double stuScore) {
		super();
		this.stuName = stuName;
		this.stuSex = stuSex;
		this.stuScore = stuScore;
	}

	public Student() {
		super();
		// TODO Auto-generated constructor stub
	}
	// getter，setter

	public String getStuName() {
		return stuName;
	}

	public void setStuName(String stuName) {
		this.stuName = stuName;
	}

	public String getStuSex() {
		return stuSex;
	}

	public void setStuSex(String stuSex) {
		this.stuSex = stuSex;
	}

	public double getStuScore() {
		return stuScore;
	}

	public void setStuScore(double stuScore) {
		this.stuScore = stuScore;
	}

}
